from flask import Flask, request
from ssq.JiBenFX import jiBenFX
from sql.Sql import sql
from flask_cors import CORS

# 创建 Flask 应用
app = Flask(__name__)
CORS(app)
app.register_blueprint(jiBenFX, url_prefix='/lottery/ssq')
app.register_blueprint(sql, url_prefix='/sql')

@app.before_request
def before_request():
    # 捕捉所有方法
    if request.method not in ['GET', 'POST', 'PUT', 'DELETE', 'PATCH','OPTIONS']:
        return "Method Not Allowed", 405


# 启动 Flask 应用，调试模式为 True
if __name__ == '__main__':
    app.run(debug=True, port=5000)